package com.sihan.framework.etm.test;

//import com.framework.generator.AutoCodeGenerator;
//import com.framework.generator.database.SimpleDatasource;
//import org.junit.Test;

import com.framework.boot.shiro.PasswordDetail;
import com.framework.boot.shiro.PasswordEncoder;
import com.framework.boot.shiro.model.Algorithm;
import com.sihan.framework.etm.common.util.sgmap;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;

public class CodeGenerator {
    private static sgmap sgmaps;

//  private static final String DRIVER_CLASS_NAME = "com.mysql.jdbc.Driver";
//
//  private static final String URL = "jdbc:mysql://127.0.0.1:3306/tsms?characterEncoding=utf8&useSSL=false";
//
//  private static final String USERNAME = "root";
//
//  private static final String PASSWORD = "123456";
//
//  public static void main(String[] args) {
//    SimpleDatasource datasource = new SimpleDatasource(DRIVER_CLASS_NAME, URL, USERNAME, PASSWORD);
//    new AutoCodeGenerator(datasource).executeDefault("com.sihan.framework.etm");
//  }


    public static void main(String[] args) {
//        PasswordEncoder passwordEncoder = new PasswordEncoder();
//        HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
//        hashedCredentialsMatcher.setHashAlgorithmName(Algorithm.SHA_1.getName());
//        hashedCredentialsMatcher.setHashIterations(2);
//        hashedCredentialsMatcher.setStoredCredentialsHexEncoded(true);
//        passwordEncoder.setHashedCredentialsMatcher(hashedCredentialsMatcher);
//        PasswordDetail passwordDetail = passwordEncoder.encode("123456");
//        System.out.println("密码:   " + passwordDetail.getHashedPassword());
//        System.out.println("盐:    " + passwordDetail.getSalt());


    }

}
